package twilight.companion.entity.ai;

import net.minecraft.world.entity.ai.goal.Goal;
import twilight.companion.entity.MiniYetiEntity;

import java.util.EnumSet;

public class MiniYetiCrouchGoal extends Goal {
    private final MiniYetiEntity yeti;

    public MiniYetiCrouchGoal(MiniYetiEntity yeti) {
        this.yeti = yeti;
        this.setFlags(EnumSet.of(Flag.MOVE, Flag.JUMP));
    }

    @Override
    public boolean canUse() {
        return this.yeti.isCrouching();
    }

    @Override
    public boolean canContinueToUse() {
        return this.yeti.isCrouching();
    }

    @Override
    public boolean isInterruptable() {
        return false;
    }

    @Override
    public void start() {
        this.yeti.getNavigation().stop();
    }

    @Override
    public void tick() {
        this.yeti.getNavigation().stop();
    }
}